\section{apriori::itemset\_\-container$<$ transaction, collection $>$ Class Template Reference}
\label{classapriori_1_1itemset__container}\index{apriori::itemset_container@{apriori::itemset\_\-container}}
{\tt \#include $<$itemset\_\-container.h$>$}

\subsection*{Public Types}
\begin{CompactItemize}
\item 
typedef \bf{itemset}$<$ transaction, collection $>$ \bf{t\_\-item}\label{classapriori_1_1itemset__container_e191370ce8d7976786e41a07a8a55085}

\item 
typedef transaction::data\_\-ptr \bf{data\_\-ptr}\label{classapriori_1_1itemset__container_48e753b5998ed2757b2b6f7ac65c6d61}

\item 
typedef transaction::data\_\-coll \bf{data\_\-coll}\label{classapriori_1_1itemset__container_9de2153ae181696bef4a85ae407ee062}

\item 
typedef transaction::ptr \bf{trans\_\-ptr}\label{classapriori_1_1itemset__container_d9e184c6e55b791bcf02bd4ebbfd7abc}

\item 
typedef collection$<$ \bf{trans\_\-ptr} $>$ \bf{t\_\-trans\_\-coll}\label{classapriori_1_1itemset__container_f55729e4b3cb1b92008d9427aa8ed337}

\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
\bf{itemset\_\-container} ()\label{classapriori_1_1itemset__container_8574268414215775974cfc09a342601f}

\item 
\bf{$\sim$itemset\_\-container} ()\label{classapriori_1_1itemset__container_5fff77f865cc34aae158f904d4287dc8}

\item 
list$<$ \bf{t\_\-item} $>$ \& \bf{get\_\-items} ()\label{classapriori_1_1itemset__container_45ee50d4db4ee2eef5a204b4069dad94}

\item 
const list$<$ \bf{t\_\-item} $>$ \& \bf{get\_\-items} () const \label{classapriori_1_1itemset__container_2656d8db12a757a0a6889cbd63509a1a}

\item 
void \bf{cut} (int support, float confidence)
\item 
void \bf{initialize} (const \bf{t\_\-trans\_\-coll} \&coll)
\item 
void \bf{calc\_\-support} (const \bf{t\_\-trans\_\-coll} \&col)
\item 
void \bf{generate} (\bf{t\_\-trans\_\-coll} \&trans)
\item 
template$<$class T$>$ void \bf{write} (T \&t)\label{classapriori_1_1itemset__container_44ab3edc0c821338cb33a57aabadf225}

\end{CompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$class transaction, template$<$ class $>$ class collection$>$ class apriori::itemset\_\-container$<$ transaction, collection $>$}

This class implements a collection for the itemsets, and provides several methods for crossproducts of sets for the itemsets. 



Definition at line 25 of file itemset\_\-container.h.

\subsection{Member Function Documentation}
\index{apriori::itemset_container@{apriori::itemset\_\-container}!calc_support@{calc\_\-support}}
\index{calc_support@{calc\_\-support}!apriori::itemset_container@{apriori::itemset\_\-container}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class transaction, template$<$ class $>$ class collection$>$ void \bf{apriori::itemset\_\-container}$<$ transaction, collection $>$::calc\_\-support (const \bf{t\_\-trans\_\-coll} \& {\em col})\hspace{0.3cm}{\tt  [inline]}}\label{classapriori_1_1itemset__container_eff4d71c241c3fe7ed970764980a0365}


Calculates the support of each itemset with the transactions in col 

Definition at line 78 of file itemset\_\-container.h.

\begin{Code}\begin{verbatim}79                 {
80                         typedef typename list<t_item>::iterator it;
81                         for(it i = _items.begin(); i != _items.end(); ++i)
82                         {
83                                 i->check_support(col);
84                         }
85                 }
\end{verbatim}\end{Code}


\index{apriori::itemset_container@{apriori::itemset\_\-container}!cut@{cut}}
\index{cut@{cut}!apriori::itemset_container@{apriori::itemset\_\-container}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class transaction, template$<$ class $>$ class collection$>$ void \bf{apriori::itemset\_\-container}$<$ transaction, collection $>$::cut (int {\em support}, float {\em confidence})\hspace{0.3cm}{\tt  [inline]}}\label{classapriori_1_1itemset__container_9b19ee74ada6a7d1ed5bba674837892b}


deletes all itemsets with support $<$ s 

Definition at line 43 of file itemset\_\-container.h.

\begin{Code}\begin{verbatim}44                 {
45                         typedef typename list<t_item>::iterator it;
46                         it iter = _items.begin(), lim = _items.end();
47                         while(iter != lim) {
48                                 if(iter->get_support() < support ||
49                                    iter->get_confidence() < confidence) {
50                                         _items.erase(iter++);
51                                 } else {
52                                         iter++;
53                                 }
54                         }
55                 }
\end{verbatim}\end{Code}


\index{apriori::itemset_container@{apriori::itemset\_\-container}!generate@{generate}}
\index{generate@{generate}!apriori::itemset_container@{apriori::itemset\_\-container}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class transaction, template$<$ class $>$ class collection$>$ void \bf{apriori::itemset\_\-container}$<$ transaction, collection $>$::generate (\bf{t\_\-trans\_\-coll} \& {\em trans})\hspace{0.3cm}{\tt  [inline]}}\label{classapriori_1_1itemset__container_8fcb7309a795c46a62217a577201854d}


generates new itemsets with a new cardinality 

Definition at line 90 of file itemset\_\-container.h.

\begin{Code}\begin{verbatim}91                 {
92                         if(_items.empty()) {
93                                 throw runtime_error(
94                                 "Error, no itemsets are available");
95                         }
96                         // here we go...
97                         _card++;
98                         find_itemsets();
99                         calc_support(trans);
100                 }
\end{verbatim}\end{Code}


\index{apriori::itemset_container@{apriori::itemset\_\-container}!initialize@{initialize}}
\index{initialize@{initialize}!apriori::itemset_container@{apriori::itemset\_\-container}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class transaction, template$<$ class $>$ class collection$>$ void \bf{apriori::itemset\_\-container}$<$ transaction, collection $>$::initialize (const \bf{t\_\-trans\_\-coll} \& {\em coll})\hspace{0.3cm}{\tt  [inline]}}\label{classapriori_1_1itemset__container_4a2d413c6ae41087928db883c4e03ac6}


Creates the initial unique itemsets 

Definition at line 60 of file itemset\_\-container.h.

\begin{Code}\begin{verbatim}61                 {
62                         // first of all: create list of all items...
63                         list<data_ptr> list;
64                         typedef typename t_trans_coll::const_iterator it;
65                         for(it i = coll.begin(); i != coll.end(); ++i) {
66                                 append_list(list, (*i)->get_elements());
67                         }
68                         // create unique list...
69                         create_itemsets(list);
70                         calc_support(coll);
71                         _card = 0;
72                 }
\end{verbatim}\end{Code}




The documentation for this class was generated from the following file:\begin{CompactItemize}
\item 
music/apriori/itemset\_\-container.h\end{CompactItemize}
